﻿create procedure [dbo].[usp_LogEntryUpdate] 
	@LogEntryId int
	, @ConcurrencyId rowversion
	, @PublicationId uniqueidentifier
	, @AppDomainId int
	, @AssemblyId int
	, @MachineId int
	, @ProcessId int
	, @ThreadId int
	, @WorkItemId int
	, @LogEntry nvarchar(max) 
	, @Priority int
	, @Type int
	, @SerializedIIdentityXml xml
	, @IIdentityName nvarchar(255) 
	, @IIdentityIsAuthenticated bit
	, @IIdentityAuthenticationType nvarchar(255) 
as

begin try
	
	begin transaction
	
		update [dbo].[LogEntry]
		set
			PublicationId = @PublicationId
			, AppDomainId = @AppDomainId
			, AssemblyId = @AssemblyId
			, MachineId = @MachineId
			, ProcessId = @ProcessId
			, ThreadId = @ThreadId
			, WorkItemId = @WorkItemId
			, LogEntry = @LogEntry
			, Priority = @Priority
			, Type = @Type
			, SerializedIIdentityXml = @SerializedIIdentityXml
			, IIdentityName = @IIdentityName
			, IIdentityIsAuthenticated = @IIdentityIsAuthenticated
			, IIdentityAuthenticationType = @IIdentityAuthenticationType 
		where LogEntryId = @LogEntryId and ConcurrencyId = @ConcurrencyId
		
	commit transaction

end try
	
begin catch
	if @@trancount > 0
	begin
		rollback transaction;
	end
	execute [dbo].[usp_SqlErrorInsert]
end catch